package zorg.example.rest_demo.repo

import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.data.rest.core.annotation.RepositoryRestResource
import org.springframework.data.rest.core.annotation.RestResource
import zorg.example.rest_demo.entity.Class

@RepositoryRestResource(collectionResourceRel = "class", path = "class")
interface ClassRepository : JpaRepository<Class, Long> {

    @RestResource(exported = true)
    override fun getReferenceById(id: Long): Class

    @RestResource(exported = true)
    override fun deleteById(id: Long)

    @RestResource(exported = true)
    override fun <S : Class?> saveAndFlush(entity: S & Any): S & Any
}